\begin{problem}{Short Taps}{shorttaps.in}{shorttaps.out}{2 seconds}{}{}

     You want to send some messages of various 
     lengths (specified in the number of minutes it 
     takes to send them), and don't want more than three of 
     them to be completely intercepted. A message is 
     considered to be intercepted if some malevolent person taps your 
     connection the whole time the message is being sent (a 
     partially tapped message won't do this person any good). 
     Assuming that the connection is being tapped during $T$
     consecutive minutes, what's the shortest time you need to 
     send all the messages so at most three of the 
     messages can be completely intercepted? 

Each message is sent in one continuous transmission, though any 
number of messages can be sent in parallel. You can 
only start sending a message at the beginning of 
a minute. The messages can be sent in any order. 

Write a program which takes an integer $T$
and a list of message times
(containing the time in minutes it takes to send each message, respectively) 
and returns the minimum time needed to send all the 
messages so that at most three of them can be intercepted. 
 
\InputFile

The first line contain $T$ ($1\le T\le 100$) and a number of messages
$N$ ($1\le N\le 50$). The second line contains
a list of message times, each time is between 1 and 100, inclusive. 

\OutputFile

Output the shortest time needed to 
     send all the messages so at most three of the 
     messages can be completely intercepted.

\Example

\begin{examplewide}
\exmp{
10 7
2 3 4 5 6 7 8
}{
14
}%
\exmp{
40 8
30 40 50 60 70 80 90 100
}{
100
}%
\end{examplewide}

\end{problem}